package org.flexthinker.binding.value
{
    /**
     * Describes models with a generic access to a single value that allow
     * to observe value changes. The value can be accessed using the
     * <code>#getValue()</code>/<code>#setValue(Object)</code>/
     * <code>#setValueSilently(Object, PropertyChangeListener)</code>
     * methods. Observers can register instances of <code>PropertyChangeListener</code>
     * to be notified if the value changes.
     *
     * <p>The listeners registered with this ValueModel using #addValueChangeListener
     * will be invoked only with PropertyChangeEvents </p>
     *
     * <p>AbstractValueModel minimizes the effort required to implement this interface.
     * It uses the PropertyChangeSupport to fire PropertyChangeEvents, and it adds
     * PropertyChangeListeners for the specific property name "value". This ensures
     * that the constraint mentioned above is met.</p>
     */
    public interface ValueModel extends EqualsCapableObject
    {
        function getValue():Object;
        function setValue(value:Object):void;

        function addValueChangeListener(listener:PropertyChangeListener):void;/**
         * Unregisters the given <code>PropertyChangeListener</code> from this
         * ValueModel.
         *
         * @param listener the listener to be removed
         */
        function removeValueChangeListener( listener:PropertyChangeListener):void;

        function removeAllListener():void;

    }
}